﻿using System;
using System.Collections.Generic;
//
namespace PerceptiveMCAPI.Types
{
	public class campaignsResults
	{
		public int total { get; set; }
		public List<DataItem> data { get; set; }
		public campaignsResults()
		{
			data = new List<DataItem>();
		}
		// -------------------------------
		public class DataItem
		{
			public string id { get; set; }
			public double web_id { get; set; }
			public string list_id { get; set; }
			public double folder_id { get; set; }
			public double template_id { get; set; }
			public EnumValues.content_type content_type { get; set; }

			public string title { get; set; }
			public EnumValues.campaign_type type { get; set; }
			public DateTime create_time { get; set; }
			public DateTime send_time { get; set; }
			public int emails_sent { get; set; }
			public EnumValues.campaign_status status { get; set; }
			public string from_name { get; set; }
			public string from_email { get; set; }
			public string subject { get; set; }
			public string to_name { get; set; }
			public string archive_url { get; set; }
			public bool inline_css { get; set; }
			//
			public string analytics { get; set; }
			public string analytics_tag { get; set; }
			// --- 
			public bool authenticate { get; set; }
			public bool ecomm360 { get; set; }
			public bool auto_tweet { get; set; }
			public List<string> auto_fb_post { get; set; }
			public bool auto_footer { get; set; }
			public bool timewarp { get; set; }
			public string timewarp_schedule { get; set; }
			// --- 
			public campaignTracking tracking { get; set; }
			public string segment_text { get; set; }
			public campaignSegmentOptions segment_opts { get; set; }
			public Dictionary<string, string> type_opts { get; set; }
			// --------------------------
			public DataItem()
			{
				content_type = EnumValues.content_type.NotSpecified;
				type = EnumValues.campaign_type.NotSpecified;
				create_time = DateTime.MinValue;
				send_time = DateTime.MinValue;
				status = EnumValues.campaign_status.Unknown;
				auto_fb_post = new List<string>();
				tracking = new campaignTracking( false, false, false );
				segment_opts = new campaignSegmentOptions();
				type_opts = new Dictionary<string, string>();
			}

			public override string ToString()
			{
				return string.Format( "id: {0}, web_id: {1}, list_id: {2}, folder_id: {3}, title: {4}, type: {5}, subject: {6}, emails_sent: {7}, send_time: {8}",
					id, web_id, list_id, folder_id, title, type, subject, emails_sent, send_time );
			}
		}
	}
}
